﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp6
{
    //4、超人、小鸟、飞机
    class Flight
    {
        private string name;
        public string Name { get => name; set => name = value; }
        public Flight(string name)
        {
            this.name = name;
        }
        public Flight()
        {

        }
    }

    
    interface ILand
    {
        void Land();
    }
        interface IEat
        {
            void Eat();
        }
        class Superman : Flight, IFly, ILand, IEat
        {
            public void Fly()
            {
                Console.WriteLine("姓名叫{0}的超人正在天上飞行", this.Name);
            }
            public void Land()
            {
                Console.WriteLine("姓名叫{0}的超人正在准备着陆", this.Name);
            }
            public void Eat()
            {
                Console.WriteLine("姓名叫{0}的超人正在吃软饭", this.Name);
            }
            public Superman(string name) : base(name)
            {

            }
        }
        class Bird : Flight, IFly, ILand, IEat
        {
            public void Fly()
            {
                Console.WriteLine("名叫{0}的小鸟正在空中飞行", this.Name);
            }
            public void Land()
            {
                Console.WriteLine("名叫{0}的小鸟正在树上着点", this.Name);
            }
            public void Eat()
            {
                Console.WriteLine("名叫{0}的小鸟正在吃毛毛虫", this.Name);
            }
            public Bird(string name) : base(name)
            {

            }
        }
    class Plane : Flight, IFly, ILand, IEat
    {
        public void Fly()
        {
            Console.WriteLine("名叫{0}的战斗机正在扫射飞行", this.Name);
        }
        public void Land()
        {
            Console.WriteLine("名叫{0}的战斗机正在着陆", this.Name);
        }
        public void Eat()
        {
            Console.WriteLine("名叫{0}的战斗机正在加油战斗中", this.Name);
        }
        public Plane(string name) : base(name)
        {

        }
    }
}

